﻿namespace _13_BinaryToDecimalNumber
{
    using System;
    class Program
    {
        static void Main()
        {

            string inputBinary = Console.ReadLine();

            long number = 0;

            for (int i = 0; i < inputBinary.Length; i++)
            {
                if (inputBinary[inputBinary.Length - 1 -i] == '0')
                {
                    number += 0 * (long)Math.Pow(2, i);
                }

                else
                {
                    number += 1 * (long)Math.Pow(2, i);
                }

            }
            Console.WriteLine(number);        
        
        }
    }
}
